//
//  ZZCNavigationController.m
//  ZZC-Finance
//
//  Created by mac on 2017/5/21.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "ZZCNavigationController.h"
#import "ZZCTabBarController.h"
@interface ZZCNavigationController ()

@end

@implementation ZZCNavigationController

+ (void)initialize {
    [super initialize];
    
    [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor], NSFontAttributeName :  [UIFont systemFontOfSize:19]}];
    [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithHex:0xEB6927]];
    [[UINavigationBar appearance] setTranslucent:NO];
    [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    
    if (self.viewControllers.count > 0) {
        
        viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem backBarButtonWithTarget:self action:@selector(popViewControllerAnimated:)];
        
        // 全局滑动手势
        self.interactivePopGestureRecognizer.enabled = YES;
        self.interactivePopGestureRecognizer.delegate = nil;
        viewController.hidesBottomBarWhenPushed = YES;
    }
    
    [super pushViewController:viewController animated:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationBar.barStyle = UIBarStyleBlack;
}

@end
